package com.atguigu.fruit.view;

import com.atguigu.fruit.controller.FruitController;

/**
 * @author BruceLee
 * @create 2022-02-28 20:40
 */
public class FruitView {
    public static void main(String[] args) {
        FruitController fruitController = new FruitController();

        boolean flag = true;
        while (flag){
            int slt = fruitController.showMainMenu();
            switch (slt){
                case 1:
                    fruitController.showFruitList();
                    break;
                case 2:
                    fruitController.addFruit();
                    break;
                case 3:
                    fruitController.showFruitInfo();
                    break;
                case 4:
                    fruitController.delFruit();
                    break;
                case 5:
                    flag = fruitController.exit();
                    System.out.println("已退出程序，欢迎下次使用！");
                    break;
                default:
                    System.out.println("输错了，请重新输入：");
                    break;

            }
        }
    }
    
}
